/*
 * @Author: yli
 * @Date: 2021-05-02 20:39:55
 * @LastEditors: yli
 * @LastEditTime: 2021-05-03 00:09:38
 * @Description: file content
 */

#ifndef KEY_H_
#define KEY_H_
#include "stdint.h"

typedef struct _KeyStatus
{
    uint8_t pressed;
    uint16_t pressed_nT; // 持续按下的周期数
} KeyStatus;

extern KeyStatus Key1Status;
extern KeyStatus Key2Status;

void Key_init(void);
void KeyPressedScan(uint8_t key_type, uint8_t mode);
void ClearKeyStatus(KeyStatus *key_status);

typedef enum{Key1, Key2} Keyx;
uint8_t KeyPressing(Keyx key_x);

#endif // KEY_H_
